package com.pek.control.controller;

import com.alibaba.fastjson2.JSONObject;
import com.pek.config.Validate;
import com.pek.control.entity.UserEntity;
import com.pek.control.service.IUserService;
import com.pek.control.util.RedisUtil;
import com.pek.security.LoginService;
import com.pek.util.RestResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/auth")
@RestController
public class AuthController {
    @Autowired
    private PasswordEncoder passwordEncoder;

    @Autowired
    private IUserService userService;

    @Autowired
    private RedisUtil redisUtil;

    @Autowired
    private Validate validate;

    @Autowired
    private LoginService loginService;
    @PostMapping("/login")
    private RestResult<String> login(@RequestBody UserEntity loginUser) {
        return loginService.login(loginUser);
    }
}
